<?php

class Database
{
	public static function save(Entity $entity)
	{
		$dao = new GenericDao($entity);
		return $dao->save($entity);
	}
	
	public static function deactivate(Entity $entity)
	{
		$dao = new GenericDao($entity);
		return $dao->deactivate($entity);
	}
	
	public static function findAll($entity,$page=null,$pagesize=30)
	{
		$dao = new GenericDao($entity);
		return $dao->findAll($page,$pagesize);
	}
	
	public static function findByCriteria($entity,$where,$params=Array(),$page=null,$pagesize=30)
	{
		$dao = new GenericDao($entity);
		return $dao->findByCriteria($where, $params,$page,$pagesize);
	}
	
	public static function findById($entity,$id)
	{
		$dao = new GenericDao($entity);
		return $dao->findById($id);
	}

}

?>